load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")

oncall("scm_client_infra")

cpp_library(
    name = "filtered_object_id",
    srcs = ["FilteredObjectId.cpp"],
    headers = ["FilteredObjectId.h"],
    deps = [
        "//eden/common/utils:enum",
        "//eden/common/utils:throw",
        "//eden/fs/store:backing_store_interface",
        "//folly:varint",
        "//folly/logging:logging",
    ],
    exported_deps = [
        "//eden/common/utils:path",
        "//eden/fs/model:model",
    ],
)

cpp_library(
    name = "filters",
    headers = [
        "Filter.h",
    ],
    exported_deps = [
        "//eden/common/utils:immediate_future",
        "//eden/common/utils:path",
        "//folly:range",
    ],
)

cpp_library(
    name = "glob_filter",
    srcs = ["GlobFilter.cpp"],
    headers = ["GlobFilter.h"],
    deps = [
        "//eden/common/utils:immediate_future",
    ],
    exported_deps = [
        ":filters",
        "//eden/common/utils:case_sensitivity",
        "//eden/fs/utils:eden_error",
        "//eden/scm/lib/edenfs_ffi:edenfs_ffi",  # @manual
        "//eden/scm/lib/edenfs_ffi:edenfs_ffi-wrapper",  # @manual
        "//eden/scm/lib/edenfs_ffi:edenfs_ffi@header",  # @manual
    ],
)

cpp_library(
    name = "hg_sparse_filter",
    srcs = ["HgSparseFilter.cpp"],
    headers = ["HgSparseFilter.h"],
    os_deps = [
        (
            "windows",
            ["fbsource//third-party/rust:cxx"],
        ),
    ],
    preferred_linkage = "static",
    undefined_symbols = True,
    deps = [
        "//eden/fs/model:model",
        "//eden/fs/service:thrift_util",
        "//folly/futures:core",
    ],
    exported_deps = [
        "fbsource//third-party/rust:cxx-core",
        ":filters",
        "//eden/scm/lib/edenfs_ffi:edenfs_ffi",  # @manual
        "//eden/scm/lib/edenfs_ffi:edenfs_ffi-wrapper",
        "//eden/scm/lib/edenfs_ffi:edenfs_ffi@header",  # @manual
        "//folly/container:f14_hash",
        "//folly/logging:logging",
    ],
)
